<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<fmt:bundle
	basename="br.com.universidade.castelo.branco.resources.ApplicationResources"
	prefix="">
	<head>

	<link rel="stylesheet" type="text/css" href="resources/js/jquery/apprise.css" />
	<script src="resources/js/jquery/jquery-1.4.4.min.js"></script>
	<script src="resources/js/jquery/apprise-1.5.full.js"></script>
	
	<link rel="stylesheet" href="resources/js/jquery/jquery-ui.css" />
	<script src="resources/js/jquery/jquery-1.9.1.js"></script> 
	<script src="resources/js/jquery/jquery-ui.js"></script>


<script type="text/javascript">
	function chamaExcluirPesquisa(id_pesquisa) {
		$(function() {
			$("#dialog-confirmaExclusao").dialog({
				resizable : false,
				height : 140,
				modal : true,
				buttons : {
					"OK" : function() {
						$(this).dialog("close");
						excluirPesquisa(id_pesquisa);
					},
					"Cancelar" : function() {
						$(this).dialog("close");
					}
				}
			});
		});
	}

	function excluirPesquisa(id_pesquisa) {
		$.ajax({
			type : 'POST',
			url : 'excluiPesquisa?id_pesquisa=' + id_pesquisa,
			success : function() {
				pesquisaExcluida();
			}
		});
	}

	function pesquisaExcluida() {
		window.location.href ='pesquisaExcluida';
	}
</script>


<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" type="text/css" href="resources/css/formatos.css" />
	</head>
	<body>
		<jsp:include page="/WEB-INF/views/pesquisadesatisfacao/pesquisa/formularioConsultaPesquisa.jsp"
			flush="true"></jsp:include>

		<img src="resources/imagens/pixel_transparente.gif" height="5%"
			width="10%">
			
		<div align="center">

		<fieldset id="fieldsetConsulta">

			<legend id="alinhamentoFormConsulta">
				<h3>
					<fmt:message key="consulta.modulo.pesquisa.titulo"></fmt:message>
				</h3>
			</legend>

			
				<table class=linhasAlternadas align="center">

					<tr>
						
						<th><fmt:message key="consulta.modulo.pesquisa.campo.tema"></fmt:message></th>
						<th><fmt:message key="consulta.modulo.pesquisa.campo.objetivo"></fmt:message></th>
						<th><fmt:message key="consulta.modulo.pesquisa.campo.comentario"></fmt:message></th>
						<th><fmt:message key="consulta.modulo.pesquisa.campo.data.inicio"></fmt:message></th>
						<th><fmt:message key="consulta.modulo.pesquisa.campo.data.termino"></fmt:message></th>
						<th><fmt:message key="consulta.modulo.pesquisa.campo.questionario"></fmt:message></th>
						<th><fmt:message key="consulta.modulo.colaborador.campo.alterar"></fmt:message></th>
						<th><fmt:message key="consulta.modulo.colaborador.campo.excluir"></fmt:message></th>
					</tr>

					<c:forEach items="${pesquisas}" var="pesquisa">
						<tr>
							
							<td>${pesquisa.tema}</td>
							<td>${pesquisa.objetivo}</td>
							<td>${pesquisa.comentario}</td>
							<td><fmt:formatDate value="${pesquisa.dataInicio}"/></td>
							<td><fmt:formatDate value="${pesquisa.dataTermino}"/></td>
							<td>${pesquisa.auxTitulo}</td>
							<td><a href="exibePesquisa?id_pesquisa=${pesquisa.id_pesquisa}"><div class=imgAlterar></div></a></td>
							<td><a href="javascript:void(0)" onclick="chamaExcluirPesquisa(${pesquisa.id_pesquisa})"><div class=imgExcluir></div></a></td>
						</tr>
					</c:forEach>
				</table>
		</fieldset>
		<table>
				<tr> 
					<td>  <div id="dialog-confirmaExclusao" title="Excluir" style="display: none;">
						<p><span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 1px 0;"></span><fmt:message key="pds.excluir"></fmt:message></p>
					</div>
					</td> 
				</tr> 
		</table>
		</div>
	</body>
</fmt:bundle>
</html>